 package com.zhangjianling.premp.dao.sys;

import com.zhangjianling.premp.entity.sys.SysDept;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;

import java.util.List;



public interface SysDeptDao extends PagingAndSortingRepository<SysDept, String>,
JpaSpecificationExecutor<SysDept>{

	SysDept findByName(SysDept dept);

	@Query("select t from SysDept t where t.parentDept IS NULL")
	List<SysDept> findTopList();
	
	//@Query("select t from SysDept t where t.deptCode = ?1")
	SysDept findByDeptCode(String deptCode);
	
}